Stream Example

The following example shows one reason why multiple streams are useful.

Two machines, Mach1 and Mach2, are to go down approximately every 4 hours for servicing. To model this, the frequency or time between failures is defined by a normal distribution with a mean value of 240 minutes and a standard deviation of 15 minutes, N(240,15). (For more information on distributions, see User Defined Distributions). The machines will go down for 10 minutes. Because no stream is specified in the normal distribution, ProModel uses stream number one to generate sample values for both machines. So if the next two numbers in stream number one result in sample values of 218.37 and 264.69, Mach1 will receive 218.37 and Mach2 will receive 264.69. Therefore, the two machines will go down at different times, Mach1 after almost four hours and Mach2 after somewhat more than four hours.

Suppose, however, that the resource to service the machines must service them both at the same time. The machines would have to go down at the same time. Stream number one will not bring them down at the same time because stream number one sends the machine’s distributions two different numbers. Using two streams (in the example below numbered ten and eleven) with the same initial seed will ensure that the machines receive the same random number every time. The two streams have the same starting seed value so they will produce exactly the same sequence of random numbers. The first number of stream ten will be exactly the same as the first number of stream eleven; the second numbers will be the same; indeed, every number will be the same.

The Streams window below shows streams ten and eleven with the same seed values.

 

By assigning stream ten to Mach1 and eleven to Mach2, both machines will go down at exactly the same time.

 

This first clock downtime for each machine will occur at the beginning of the simulation. After that, the first downtime occurs at 218.37 minutes for both machines. Defining different seed values for the streams would produce different sequences and therefore different downtimes. Using the same stream number for the clock downtimes would also produce different values. But two different streams with the same seed value will bring both machines down at the same times.

Note that if a third machine were to use one of the streams, for example if Mach3 were to use stream eleven, the two machines would no longer go down together. Mach1 would use the first value from stream ten; Mach2 would use the first value from stream eleven; and Mach3 would use the second value from stream eleven. The first time Mach1 and Mach2 went down, they would go down at the same time because the first number in streams ten and eleven is the same. But thereafter they would not. The second time they would go down at different times because Mach1 would receive the second value from stream ten, Mach2 would receive the third value from stream eleven, and Mach3 would receive the fourth value from stream eleven.

Please note

Stream notes:

1. If a stream value is not specified for a distribution, the stream is assumed to be stream one. Stream #1 does not automatically reset after each replication.

2. The stream parameter is always the last parameter specified in a distribution unless a location parameter is also specified. See Distribution Functions for details.